$OpenBSD: patch-src_sim_s_msg_c,v 1.3 2017/05/09 13:01:42 espie Exp $
Index: src/sim/s_msg.c
--- src/sim/s_msg.c.orig
+++ src/sim/s_msg.c
@@ -68,13 +68,19 @@ short LastPicNum;
 short autoGo;
 short HaveLastMessage = 0;
 char LastMessage[256];
-int DoAutoGoto(short x, short y, char *msg);
-int DoShowPicture(short id);
+void DoScenarioScore(int type);
+void CheckGrowth(void);
+void SetMessageField(char *);
+void DoAutoGoto(short x, short y, char *msg);
+void DoShowPicture(short id);
+void DoLoseGame(void);
+void DoWinGame(void);
 
 /* comefrom: Simulate */
+void
 SendMessages(void)
 {
-  register z;
+  register int z;
   short PowerPop;
   float TM;
 
@@ -186,6 +192,7 @@ SendMessages(void)
 
 
 /* comefrom: SendMessages */
+void
 CheckGrowth(void)
 {
   QUAD ThisCityPop;
@@ -212,6 +219,7 @@ CheckGrowth(void)
 
 
 /* comefrom: SendMessages */
+void
 DoScenarioScore(int type)
 {
   short z;
@@ -251,6 +259,7 @@ DoScenarioScore(int type)
 }
 
 
+void
 ClearMes(void)
 {
   MessagePort = 0;
@@ -262,6 +271,7 @@ ClearMes(void)
 
 /* comefrom: MakeEarthquake MakeFire MakeFire MakeFlood SendMessages 
 	     CheckGrowth DoScenarioScore DoPowerScan */
+int
 SendMes(int Mnum)
 {
   if (Mnum < 0) {
@@ -294,6 +304,7 @@ void SendMesAt(short Mnum, short x, short y)
 }
 
 
+void
 doMessage(void) 
 {
   char messageStr[256];
@@ -401,16 +412,18 @@ doMessage(void) 
 }
 
 
+void
 DoAutoGoto(short x, short y, char *msg)
 {
   char buf[256];
 
   SetMessageField(msg);
-  sprintf(buf, "UIAutoGoto %d %d", x, y);
+  snprintf(buf, 256, "UIAutoGoto %d %d", x, y);
   Eval(buf);
 }
 
 
+void
 SetMessageField(char *str)
 {
   char buf[256];
@@ -419,27 +432,30 @@ SetMessageField(char *str)
       strcmp(LastMessage, str)) {
     strcpy(LastMessage, str);
     HaveLastMessage = 1;
-    sprintf(buf, "UISetMessage {%s}", str);
+    snprintf(buf, 256, "UISetMessage {%s}", str);
     Eval(buf);
   }
 }
 
 
+void
 DoShowPicture(short id)
 {
   char buf[256];
 
-  sprintf(buf, "UIShowPicture %d", id);
+  snprintf(buf, 256, "UIShowPicture %d", id);
   Eval(buf);
 }
 
 
+void
 DoLoseGame()
 {
   Eval("UILoseGame");
 }
 
 
+void
 DoWinGame()
 {
   Eval("UIWinGame");
